package com.example.spring_boot;
package com.example.spring_boot.common;
import lombok.Data;
@Data

public class Result <T>{
    private int code;
    private String message;
    private T data;
    public Result(int code,String message,T data){
        this.code=code;
        this.message=message;
        this.data=data;
    }
    public static <T> Result<T> success(T data){
        return new Result<>(200,"success",data);
    }
    public static <T> Result<T>fail(int code,String message){
        return new Result<>(code,message,null);
    }
}
